<!DOCTYPE html>
<html>
<head>
<title><?php echo L('frontend_home_test');?></title>
<link rel="stylesheet" href="<?php echo WP . 'media/css/bootstraped.min.css'; ?>" />
<link rel="stylesheet" href="<?php echo WP . 'media/css/bootstraped-responsive.min.css'; ?>" />
<link rel="stylesheet" href="<?php echo WP . 'media/css/docs.css'; ?>" />
<script type="text/javascript" src="<?php echo WP . 'media/js/jquery.js'; ?>"></script>
<script type="text/javascript" src="<?php echo WP . 'media/js/bootstraped.min.js'; ?>"></script>  

<!--[if IE 7]>
    <link rel="stylesheet" href="<?php echo WP . 'media/css/font-awesome-ie7.min.css'; ?>" />
<![endif]-->

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
    <script type="text/javascript" src="<?php echo WP . 'media/js/html5shiv.js'; ?>"></script>
  <script src="assets/js/html5shiv.js"></script>
<![endif]-->
</head>
<body style="padding-bottom:300px;">
<div class="alert"><a href="<?php echo U('index');?>">返回管理首页</a> - 切换语言：<a href="?l=zh-cn">简体中文</a> | <a href="?l=zh-tw">繁体中文</a> | <a href="?l=en-us">英文</a> | 测试语言切换(效果请查看此页面title)</div> 
<div class="container">
<form action="" method="post" class="form-horizontal">
	<fieldset>
		<legend>添加多语言元素</legend>
		<div class="control-group">
			<label class="control-label" for="group">Group<em>*</em></label>
			<div class="controls">
				<select name="group" id="group">
                <?php foreach($groups as $group): ?>
                    <option value="<?php echo $group['id'];?>">
                        <?php echo $group['title'];?>
                    </option> 
                <?php endforeach; ?>
				</select>
                (所属分组)
                &nbsp;<a href="<?php echo U('addgroup'); ?>">添加分组</a>
			</div> 
		</div>
		<div class="control-group">
			<label class="control-label" for="module">Module<em>*</em></label>
			<div class="controls">
				<select name="module" id="module"></select>
                (所属模块)
                &nbsp;<a href="<?php echo U('addmodule'); ?>">添加模块</a>
			</div> 
		</div>
		<div class="control-group">
			<label class="control-label" for="key">Key<em>*</em></label>
			<div class="controls">
				<input type="text" name="key" id="key" placeholder="Unique Identity">  
				(元素唯一标识)
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="zh-cn">简体中文<em>*</em></label>
			<div class="controls">
				<textarea name="zh-cn" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="zh-tw">繁体中文</label>
			<div class="controls">
				<textarea name="zh-tw" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="en">英语</label>
			<div class="controls">
				<textarea name="en" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="ru">俄语</label>
			<div class="controls">
				<textarea name="ru" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="fr">法语</label>
			<div class="controls">
				<textarea name="fr" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="de">德语</label>
			<div class="controls">
				<textarea name="de" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="ko">韩语</label>
			<div class="controls">
				<textarea name="ko" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="ja">日语</label>
			<div class="controls">
				<textarea name="ja" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="ar">阿拉伯语</label>
			<div class="controls">
				<textarea name="ar" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="es">西班牙语</label>
			<div class="controls">
				<textarea name="es" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="pt">葡萄牙语</label>
			<div class="controls">
				<textarea name="pt" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="it">意大利语</label>
			<div class="controls">
				<textarea name="it" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="nl">荷兰语</label>
			<div class="controls">
				<textarea name="nl" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="la">拉丁语</label>
			<div class="controls">
				<textarea name="la" rows="1"></textarea>
			</div>
		</div>
		<div class="control-group"> 
			<div class="controls">
                <label class="control-label" for="key"><em>*</em> 为必填项</label>
				<button class="btn btn-primary" type="submit">Submit</button>  
			</div>
		</div> 
	</fieldset>
</form>
</div>
<div style="position:fixed;bottom:0;left:0;padding:20px;background:#eee;border-top:1px solid #555;width:100%;"> 
<p style="text-align:center;">&copy;2013 PHP @ jlzx . All Rights Reserved.</p>
</div>
<script type="text/javascript" language="javascript">
    $(function(){ 
        $.ajax({
            type:'POST',
            url: "<?php echo U('reloadmodule');?>",
            data: {'group_id': $('#group').val()},
            success:function(data){
                $('#module').html(data);
            }
        });
        $('#group').change(function(){
            var group_id = $('#group').val();
            $.ajax({
                type:'POST',
                url: "<?php echo U('reloadmodule');?>",
                data: {'group_id': group_id},
                success:function(data){
                    $('#module').html(data);
                }
            });
        });
    });
</script>
</body>
</html>